const path = require("path");

console.log(__dirname);
console.log(__filename);
// 获取文件所在的路径
console.log(path.dirname(__filename));
// 获取文件名
console.log(path.basename(__filename, ".js"));
console.log(path.parse(__filename));
console.log(path.resolve("/foo", "/bar", "baz"));
